package cn.wuxq.streamoutput.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.ai.ollama.api.OllamaApi;
import org.springframework.ai.ollama.api.OllamaOptions;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SAALLMConfig {

    @Bean(name = "qwenchatmodel")
    public ChatModel  qwen(){
        return OllamaChatModel.builder().ollamaApi(OllamaApi.builder().baseUrl("http://114.55.142.107:11434").build()).defaultOptions(OllamaOptions.builder().model("qwen3:0.6b").build()).build();
    }
    @Bean(name = "deepseekchatmodel")
    public ChatModel  deepseek(){
        return OllamaChatModel.builder().ollamaApi(OllamaApi.builder().baseUrl("http://114.55.142.107:11434").build()).defaultOptions(OllamaOptions.builder().model("deepseek-r1:1.5b").build()).build();
    }

    @Bean(name="qwenchatclient")
    public ChatClient qwenchatclient(@Qualifier("qwenchatmodel") ChatModel chatModel){
        return ChatClient.builder(chatModel).build();
    }

    @Bean(name="deepseekchatclient")
    public ChatClient deepseekchatclient(@Qualifier("deepseekchatmodel") ChatModel chatModel){
        return ChatClient.builder(chatModel).build();
    }
}
